// import Vue from 'vue'
import { setTheme } from '@/assets/theme/theme'

const state = {
  theme: localStorage.getItem('theme') || 'default',
  activeUrl: localStorage.getItem('theme') || 'default'
}

const mutations = {
  setThemeStore(state, theme) {
    setTheme(theme)
  },
  setActiveUrl(state, url) {
    localStorage.setItem('activeUrl', url)
  }
}

const actions = {
  setThemeStore({ commit }) {
    commit('setThemeStore')
  },
  setActiveUrl({ commit }) {
    commit('setActiveUrl')
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
